package com.xmut.mall.auth.controller;

import com.xmut.mall.auth.service.PassWordService;
import com.xmut.mall.auth.utils.RespBean;
import com.xmut.mall.auth.vo.ResetPasswordVo;
import com.xmut.mall.auth.vo.ValidateCodeVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class PassWordController {

    @Autowired
    private PassWordService passWordService;

    /**
     * 校验验证码
     * @param vo
     * @return
     */
    @PostMapping("/validateCode")
    public RespBean validateCode(@RequestBody ValidateCodeVo vo){
        return passWordService.validateCode(vo);
    }

    /**
     * 重置密码
     * @param vo
     * @return
     */
    @PostMapping("/resetPassword")
    public RespBean resetPassword(@RequestBody ResetPasswordVo vo){
        return passWordService.resetPassword(vo);
    }
}
